package com.example.day1801;

import java.io.*;

/**
 * @author Lenovo
 */
public class BufferedStreaamDemo02 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw = new BufferedWriter(new
                FileWriter("myCharStream\\bw.txt"));
        for (int i = 0; i < 10; i++) {
            bw.write("hello" + i);
            //bw.write("\r\n");
            bw.newLine();
            bw.flush();
    }
        bw.close();
        BufferedReader br = new BufferedReader(new
                FileReader("myCharStream\\bw.txt"));
        String line;
        while ((line=br.readLine())!=null) {
            System.out.println(line);
    }
        br.close();
    }
}
